﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


namespace Chemix.Instrument
{
    public class WaitAndDestroy : MonoBehaviour
    {
        public float lifetime
        {
            get;
            set;
        }

        // Use this for initialization
        void Start()
        {
            StartCoroutine(WaitDestroy());
        }

        IEnumerator WaitDestroy()
        {
            yield return new WaitForSeconds(lifetime);
            Destroy(gameObject);
        }

        // Update is called once per frame
        void Update()
        {

        }
    }
}